require("../scss/admin_home.scss")
require("../scss/admin_home_course.scss")

import {Provider} from "react-redux"
import {AdminCourseCtrlContainer} from "./containers/admin/AdminCourseCtrlContainer.jsx"
import AdminHeader from "./components/admin/AdminHeader/AdminHeader.jsx"
import AdminSidebar from "./components/admin/AdminSidebar/AdminSidebar.jsx"

const createStoreWithMiddleware = require("./common/common").createStoreWithMiddleware
import adminCourseCtrlApp from "./reducers/admin/admin_course_reducers.js"

let store = createStoreWithMiddleware(adminCourseCtrlApp)       // store和reducers绑定在一起（数据和数据处理绑定在一起）

store.subscribe(() => {

})

ReactDOM.render(
    <AdminHeader />,
    document.getElementById("AdminHeader")
)

ReactDOM.render(
    <AdminSidebar />,
    document.getElementById("AdminSidebar")
)

// 绑定到组件上，让dispatch，state和组件的props关联起来
ReactDOM.render(
    <Provider store={store}>
        <AdminCourseCtrlContainer />
    </Provider>,
    document.getElementById("AdminCourseCtrl")
)